home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
comm
/
misc
/
dcdd_v2_4.lha
/
DCDDtime.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-18
|
5KB
|
217 lines
/*
DCDDtime.rexx Version 1.3e 950818.2152
940725 - changed PNET NewBillDay from 06 to 01 and NewBillAdj to 'NONE'
950818 - added 1 digit to hours to show 3 digits. (darn internet!!!)
*/
address command
OPTIONS RESULTS
windev = "CON:150/50/380/110/DCDDtime "
if ~open('wind',windev) then exit /* Window for all activity */
call J_DATE
call wsay(' ')
/* TotalBy = 'CRIS' */
TotalBy = 'PNET'
call GetToday
call GetTimeTitle
call GetTotTime
X_temp= ' ONLINE CONNECT TIME FOR SERVICES BELOW '
call wsay(X_temp)
call wsay(' ')
X_temp= ' ' right(thours,3,'0')':'right(tmins,2,'0')':'right(tsecs,2,'0') ' - 'TotalBy' - ' NewBillDay date('m',dateYYYYMMDDx,'s')
call wsay(X_temp)
TotalBy = 'LONGD'
call GetToday
call GetTimeTitle
call GetTotTime
X_temp= ' ' right(thours,3,'0')':'right(tmins,2,'0')':'right(tsecs,2,'0') ' - 'TotalBy' - ' NewBillDay date('m',dateYYYYMMDDx,'s')
call wsay(X_temp)
TotalBy = 'LOCAL'
call GetToday
call GetTimeTitle
call GetTotTime
X_temp= ' ' right(thours,3,'0')':'right(tmins,2,'0')':'right(tsecs,2,'0') ' - 'TotalBy' - ' NewBillDay date('m',dateYYYYMMDDx,'s')
call wsay(X_temp)
J_temp= ' the Amiga Era is now 'Jdate' days old'
call wsay(' ')
call wsay(J_temp)
call wsay(' ')
call wsay(' Press Return to continue')
LetMeGo = readln('wind')
exit
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Functions / Subroutines *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Function - put string to window with EOL */
wsay:
parse arg strx
call writeln('wind',strx)
return
/* Function - put string to window without EOL */
wsaych:
parse arg strx
call writech('wind',strx)
return
GetToday:
dateYYYY=left(date(sorted),4)
dateYYYYMM=left(date(sorted),6)
dateMM=right(dateYYYYMM,2)
dateYYMMDD=right(date(sorted),6)
dateDD=right(dateYYMMDD,2)
return
GetTotTime:
/* gets total time for the month */
if open('TotTime',timetitle,'R')=0 then do /* Total hours, mins, secs */
thours = 0
tmins = 0 /* If file doesn't exist, set to zero */
tsecs = 0
end
else do
thours=readln('TotTime') /* If file does exist, read them */
tmins=readln('TotTime')
tsecs=readln('TotTime')
call close('TotTime')
end
return
GetTimeTitle:
/*
Internet access has been added to DCDD and this has forced me to keep
monthly time totals for different SERVICES. I am using CRIS for my
Internet connection, LONGD for my long distance direct dialing, and
LOCAL for my local BBSes. The totals are controled the same as befor
by using NewBillDay and NewBillAdj.
If for instance NewBillDay = 8, and NewBillAdj = MINUS then the monthly
hours/minutes/seconds total will run from the 8th of one month till the
7th of the next month to match the way your phone company bills you.
NewBillAdj is used to either put the first few days of this month into
last months totals (MINUS) or the last few days of this month into next
month (PLUS). (sort of crazy but it works!)
*/
/* * * * * * ************************************************** * * * * * */
/* ********* BE SURE TO PUT THE DATA BELOW INTO DCDD.rexx ********* */
/* * * * * * ************************************************** * * * * * */
if TotalBy = ' ' then do
TotalBy = 'LONGD'
NewBillDay = 08
NewBillAdj = 'MINUS'
end
if TotalBy = 'LONGD' then do
NewBillDay = 08
NewBillAdj = 'MINUS'
end
/*
if TotalBy = 'CRIS' then do
NewBillDay = 13
NewBillAdj = 'MINUS'
end
*/
if TotalBy = 'CRIS' then do
NewBillDay = 01
NewBillAdj = 'NONE'
end
if TotalBy = 'PNET' then do
NewBillDay = 01
NewBillAdj = 'NONE'
end
if TotalBy = 'LOCAL' then do
NewBillDay = 01
NewBillAdj = 'NONE'
end
/* * * * * * ************************************************** * * * * * */
/* ********* BE SURE TO PUT THE DATA ABOVE INTO DCDD.rexx ********* */
/* * * * * * ************************************************** * * * * * */
dateMMx = dateMM
dateYYYYx = dateYYYY
if NewBillAdj = "MINUS" then do
if dateDD < NewBillDay then do
if dateMM = 01 then do
dateMMx = 12
dateYYYYx = dateYYYY - 1
end
else do
dateMMx = dateMM - 1
if dateMMx < 10 then
dateMMx = 0||dateMMx
end
end
end
if NewBillAdj = "PLUS" then do
if dateDD ~ < NewBillDay then do
if dateMM = 12 then do
dateMMx = 01
dateYYYYx = dateYYYY + 1
end
else do
dateMMx = dateMM + 1
if dateMMx < 10 then
dateMMx = 0||dateMMx
end
end
end
timetitle='dh0:DemonDialer/DCDDtime_'totalby||'_'||dateYYYYx||dateMMx
dateYYYYMMDDx = dateYYYYx||dateMMx||dateDD
if NewBillAdj = "NONE" then do
timetitle='dh0:DemonDialer/DCDDtime_'totalby||'_'||dateYYYYMM
dateYYYYMMDDx = dateYYYY||dateMM||dateDD
end
return
J_DATE:
dateYYYYMMDD = left(date(sorted),8)
JDATE = date('i',dateYYYYMMDD,'s')
return